package com.dabai.iot.core.dto;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

/**
 * 设备分组输入实体类
 *
 * @author kev1n
 */
@Data
public class DeviceGroupInput implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 父级分组
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(description = "父级分组")
    private Long parentId;

    /**
     * 分组名称
     */
    @Schema(description = "分组名称")
    @NotBlank(message = "分组名称不能为空")
    @Size(min = 1, max = 32, message = "分组名称长度必须在1-32之间")
    private String groupName;

    /**
     * 分组描述
     */
    @Schema(description = "分组描述")
    @Size(max = 256, message = "分组描述长度不超过256个字符")
    private String groupDesc;

    /**
     * 排序
     */
    @Schema(description = "排序")
    private Integer sort;

}
